import { App } from 'vue'
import { registerFormDetailProvider, registerPanelItemProvider } from '@ibiz-template/runtime'

import { FormGroupPanelProvider } from './form-group-panel/i-biz-form-group-panel.provider'
import { FormItemProvider } from './form-item/i-biz-form-item.provider'
import { FormPageProvider } from './form-page/i-biz-form-page.provider'
import { FormTabPageProvider } from './form-tab-page/i-biz-form-tab-page.provider'

export const FormComponentRegister = {
  install(v: App) {
    // 表单分组
    registerFormDetailProvider('GROUPPANEL', () => new FormGroupPanelProvider())
    // 表单项
    registerFormDetailProvider('FORMITEM', () => new FormItemProvider())
    // 表单分页
    registerFormDetailProvider('FORMPAGE', () => new FormPageProvider())
    // 表单关系界面
    registerFormDetailProvider('TABPAGE', () => new FormTabPageProvider())
  },
}

export default FormComponentRegister
